package com.atgm.mall.gmmailproduct.feign;

import com.atgm.common.to.SkuReductionTo;
import com.atgm.common.to.SpuBoundTo;
import com.atgm.common.utils.R;
import com.atgm.mall.gmmailproduct.feign.fallback.CouponFallbackService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(value = "gm-mall-coupon", fallback = CouponFallbackService.class, qualifier = "couponFeignService")
public interface CouponFeignService {

    @PostMapping("/gmmallcoupon/spubounds/save")
    R saveSpuBounds(@RequestBody SpuBoundTo spuBoundTo);

    @PostMapping("/gmmallcoupon/skufullreduction/saveInfo")
    R saveSkuReduction(@RequestBody SkuReductionTo skuReductionTo);

    /**
     * 获取优惠中的游戏信息
     * @param gameIds
     * @return
     */
    @GetMapping("/gmmallcoupon/goodssale/info")
    R getGoodsSale(@RequestParam("ids") List<Long> gameIds);

    /**
     * 获取折扣中的游戏id
     */
    @GetMapping("/gmmallcoupon/goodssale/gameIds")
    R getSaleGameIds(@RequestParam Map<String, Object> params);
}
